<script setup lang="ts">
import { onMounted, useTemplateRef } from 'vue';
import gsap from 'gsap';

const boxRef = useTemplateRef<HTMLElement>('box');

onMounted(() => {
    gsap.to(boxRef.value!, { x: 200, duration: 1, rotation: 360 });
});
</script>

<template>
    <div ref="box" class="box">Hello GSAP</div>
</template>

<style scoped lang="scss">
.box {
    width: 100px;
    height: 100px;
    background-color: coral;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
</style>
